<!--
  @author yangjiangming
  @date 2018-12-10 20:40:28
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html th:replace="~{work/modify/common/layout :: layout('改定金', ~{::title}, ~{::content}, ~{::script})}">
<head>
    <title>工单管理-改定金</title>
</head>
<body>

<div th:fragment="content">
    <style>
        .layui-form-checkbox i {
            height: 28px;
        }

        .layui-form-item .layui-form-checkbox {
            margin-top: 2px;
            margin-bottom: 18px;
        }

        /*.d-discounts{*/
        /*display: none;*/
        /*}*/
        .d-discounts-input {
            line-height: 34px;
            color: #666;
            width: auto;
        }
    </style>
    <form action="" class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 60px">订单金额</label>
            <div class="layui-inline" style="width: 200px">
                <input name="originalAmount" type="text" disabled lay-verify="required|user-number" class="layui-input d-original layui-disabled" placeholder="" autocomplete="off">
            </div>
        </div>
        <div class="layui-form-item d-discounts">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 60px">优惠总额</label>
                <div class="layui-inline d-discounts-item" id="totalOffer" style="line-height: 34px;">20.00</div>
            </div>
            <div class="layui-inline" id="offer-item">

            </div>

        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 60px">定金</label>
            <div class="layui-inline" style="width: 200px">
                <zmn th:if="${updatePriceVO.depositStatus==4 || updatePriceVO.clean == 2}">
                    <input type="text" name="depositAmount" id="depositAmount"
                           class="layui-input d-earnest layui-disabled"  placeholder="" disabled
                           autocomplete="off">
                    <span>不可修改（定金已支付或渠道不支持定金修改）</span>
                </zmn>
                <zmn th:unless="${updatePriceVO.depositStatus==4 || updatePriceVO.clean == 2}">
                    <input type="text" name="depositAmount"
                           class="layui-input d-earnest" id="depositAmount" placeholder="请输入" autocomplete="off">
                </zmn>

            </div>
        </div>
        <div class="layui-form-item">
            <zmn th:if="${updatePriceVO.prepayAmount}">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 60px">预收款</label>
                    <div class="layui-inline d-advances" style="line-height: 34px;"></div>
                </div>
            </zmn>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 80px">工程师收款金额</label>
                <div class="layui-inline d-gathering" style="line-height: 34px;"></div>
            </div>
            <div class="layui-inline">
                <zmn th:if="${(updatePriceVO.onlyVisit == 2 || updatePriceVO.masterAmount == null || updatePriceVO.masterAmount <= 3000) && updatePriceVO.clean != 2}">
                    <input type="checkbox" lay-skin="primary" class="d-visit" name="visit" value="2" title="上门费" th:checked="${updatePriceVO.onlyVisit == 2}">
                </zmn>
                <zmn th:if="${updatePriceVO.masterAmount > 3000 || updatePriceVO.clean == 2}">
                    <input type="checkbox" lay-skin="primary" class="d-visit" name="visit" value="2" title="上门费" disabled>
                </zmn>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 60px">改价缘由</label>
            <div class="layui-inline">
                <div class="layui-form-item" id="reason" style="width: 800px">
                    <zmn th:each="reason:${updatePriceReason}" >
                        <input type="checkbox" lay-skin="primary" th:title="${reason.text}" th:value="${reason.text}"
                               title="改价缘由">
                    </zmn>
                </div>
                <div class="layui-form-item" style="width: 800px">
                    <textarea class="layui-textarea" placeholder="其他改价缘由"></textarea>
                </div>
                <div class="layui-form-item" style="text-align: center;margin-top: 30px;width: 800px;">
                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-normal " id="submit-btn" lay-submit="">保存</button>
                    </div>
                </div>
            </div>
        </div>

    </form>
</div>

<script th:inline="javascript">
    var orderId = '[[${updatePriceVO.orderId}]]';
    var workId = '[[${updatePriceVO.workId}]]';
    var updatePriceVO = [[${updatePriceVO}]];
    var layuiModel = {
        oms_work_modify_price: "work/modify/zmn.oms.work.modify.price"
    };
</script>
</body>
</html>